package com.kingdee.eas.fi.arap.app;

import java.util.ArrayList;
import java.util.Hashtable;
import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.fi.arap.app.APOtherBillImporter;
import com.kingdee.eas.custom.fi.arap.app.AROtherBillImporter;
import com.kingdee.eas.custom.fi.arap.app.OtherBillImporter;
import com.kingdee.eas.tools.datatask.core.TaskExternalException;

public class ARAPImportFacadeControllerBeanEx extends
		ARAPImportFacadeControllerBean {

	
	private static final long serialVersionUID = -4525158070083697887L;

	public ARAPImportFacadeControllerBeanEx(){
		super();
	}

	@Override
	protected void _transfer(Context ctx, Hashtable hsData, String bill,ArrayList headFields, ArrayList entryFields)throws BOSException, EASBizException {
		  if(bill == null || bill.trim().length() <= 0)
	            return;
	        bill = bill.trim();
	        try {
            if(bill.equalsIgnoreCase("AR"))
            {
            	OtherBillImporter otherBillImporter = new AROtherBillImporter(ctx);       		
			    otherBillImporter.importData(ctx, hsData, headFields, entryFields);
			
            } else  if(bill.equalsIgnoreCase("AP")){ 
            	OtherBillImporter otherBillImporter = new APOtherBillImporter(ctx);       		
			    otherBillImporter.importData(ctx, hsData, headFields, entryFields);
                   
             }else
            	  super._transfer(ctx, hsData, bill, headFields, entryFields); 
            
            
	    	} catch (TaskExternalException e) {
				throw new BOSException(e.getMessage());
			
				}
		
	}
	
	
	
	
	
}
